<?php echo $this->fetch('member.header.html'); ?>
<style type="text/css">
    .float_right {float: right;}
</style>
<div class="content">
    <?php echo $this->fetch('member.menu.html'); ?>
    <div id="right">
        <?php echo $this->fetch('member.curlocal.html'); ?>
        <?php echo $this->fetch('member.submenu.html'); ?>
        <div class="wrap">
            <div class="public table">
                <?php if ($this->_var['refunds']): ?>
                <table id="refund-list" border="0" cellpadding="0" cellspacing="0">
                    <tr class="line gray">
                        <th width="80">退款编号</th>
                        <th width="140" class="pl10">订单编号/宝贝信息</th>
                        <th width="110">卖家</th>
                        <th width="80">交易金额</th>
                        <th width="80">退款总额</th>
                        <th width="100">申请时间</th>
                        <th width="100">退款状态</th>
                        <th width="75">操作</th>
                    </tr>
                    <?php $_from = $this->_var['refunds']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'refund');$this->_foreach['v'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['v']['total'] > 0):
    foreach ($_from AS $this->_var['refund']):
        $this->_foreach['v']['iteration']++;
?>
                    <tr class="line<?php if (($this->_foreach['fe_goods']['iteration'] == $this->_foreach['fe_goods']['total'])): ?> last_line<?php endif; ?>">
                        <td class="align2"><?php echo $this->_var['refund']['refund_sn']; ?></td>
                        <td class="align2"><?php echo $this->_var['refund']['order_sn']; ?><br /><a href="<?php echo url('app=goods&id=' . $this->_var['refund']['goods_id']. ''); ?>" target="_blank"><?php echo $this->_var['refund']['goods_name']; ?></a></td>
                        <td class="align2"><a href="<?php echo url('app=store&id=' . $this->_var['refund']['seller_id']. ''); ?>" target="_blank"><?php echo $this->_var['refund']['store_name']; ?></a><br /><?php echo $this->_var['refund']['user_name']; ?></td>
                        <td class="align2"><?php echo $this->_var['refund']['total_fee']; ?></td>
                        <td class="align2"><?php echo $this->_var['refund']['refund_fee']; ?></td>
                        <td class="align2" style="color:gray"><?php echo local_date("Y-m-d H:i:s",$this->_var['refund']['created']); ?></td>
                        <td class="align2" style="color:#FF4F01">
                            <?php if ($this->_var['refund']['status'] == 'CLOSED'): ?>
                            <span style="color:gray">退款关闭</span>
                            <?php elseif ($this->_var['refund']['status'] == 'SUCCESS'): ?>
                            <span style="color:#62B44B">退款成功</span>
                            <?php elseif ($this->_var['refund']['status'] == 'FAILED'): ?>
                            <span style="color:#62B44B">退款失败</span>
                            <?php elseif ($this->_var['refund']['status'] == 'WAIT_SELLER_AGREE'): ?>
                            买家申请退款，等待卖家同意
                            <?php elseif ($this->_var['refund']['status'] == 'SELLER_REFUSE_BUYER'): ?>
                            卖家拒绝退款，等待买家修改中
                            <?php elseif ($this->_var['refund']['status'] == 'WAIT_ADMIN_AGREE'): ?>
                            卖家同意退款，等待管理员审核
                            <?php elseif ($this->_var['refund']['status'] == 'WAIT_SELLER_CONFIRM'): ?>
                            退款申请等待卖家确认中
                            <?php endif; ?>	
                            <?php if ($this->_var['refund']['status'] != 'CLOSED' && $this->_var['refund']['status'] != 'SUCCESS' && $this->_var['refund']['status'] != 'WAIT_ADMIN_AGREE' && $this->_var['refund']['ask_customer'] == 1): ?><div style="color:#62B44B">（客服已介入处理）</div><?php endif; ?>
                        </td>
                        <td class="align2"> 
                            <a href="<?php echo url('app=refund&act=view&refund_id=' . $this->_var['refund']['refund_id']. ''); ?>" target="_blank">查看</a> 
                            <?php if ($this->_var['refund']['status'] != 'SUCCESS' && $this->_var['refund']['status'] != 'CLOSED' && $this->_var['refund']['status'] != 'WAIT_ADMIN_AGREE' && $this->_var['refund']['status'] != 'FAILED'): ?>
                            | <a href="<?php echo url('app=refund&act=edit&refund_id=' . $this->_var['refund']['refund_id']. ''); ?>">修改</a>
                            <?php endif; ?>
                        </td>
                    </tr>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                </table>
                <div class="order_form_page mt10">
                    <div class="page">
                        <?php echo $this->fetch('member.page.bottom.html'); ?>
                    </div>
                </div>
                <?php else: ?>
                <div class="member_no_records">
                    <span>没有符合条件的记录</span>
                </div>
                <?php endif; ?>
                <div class="clear"></div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>
<?php echo $this->fetch('footer.html'); ?>
